package it.heima.xmy.Demo01;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class Practise07 {
    public static void main(String[] args) throws IOException {
        File file1 = new File("F:\\test07\\1.mp4");
        File file2 = new File("F:\\test07\\2.mp4");
        File file3 = new File("F:\\test07\\3.mp4");
        File file = new File("F:\\test07");

        //三次读取  一次写入
        FileInputStream fis1 = new FileInputStream(file1);
        FileInputStream fis2 = new FileInputStream(file2);
        FileInputStream fis3 = new FileInputStream(file3);

        FileOutputStream fos = new FileOutputStream(new File(file, "123.mp4"),true);

        byte[] bytes1 = new byte[(int) (file1.length())];

        fos.write(bytes1, 0, fis1.read(bytes1));

        byte[] bytes2 = new byte[(int) (file2.length())];

        fos.write(bytes2, 0, fis2.read(bytes2));

        byte[] bytes3 = new byte[(int) (file3.length())];

        fos.write(bytes3, 0, fis3.read(bytes3));

        fos.close();
        fis3.close();
        fis2.close();
        fis1.close();

    }
}